using NodeCanvas.Variables;
using UnityEngine;

namespace NodeCanvas.Actions
{
	[Category("GameObject")]
	[AgentType(typeof(Transform))]
	public class InstantiateGameObject : ActionTask
	{
		public BBVector clonePosition;

		public BBGameObject saveCloneAs = new BBGameObject
		{
			blackboardOnly = true
		};

		protected override string info
		{
			get
			{
				return string.Concat("Instantiate ", base.agentInfo, " at ", clonePosition, " as ", saveCloneAs);
			}
		}

		protected override void OnExecute()
		{
			saveCloneAs.value = Object.Instantiate(base.agent.gameObject, clonePosition.value, Quaternion.identity);
			EndAction();
		}
	}
}
